[EuiBadge] Update styles to match latest design changes#9302
Conversation
...ges/eui/.loki/reference/chrome_desktop_Forms_EuiComboBox_Icons_And_Many_Options_Selected.png
Show resolved
Hide resolved
.../reference/chrome_desktop_Forms_EuiSelectable_Subcomponents_EuiSelectableList_Playground.png
Show resolved
Hide resolved
…class name string
weronikaolejniczak
left a comment
There was a problem hiding this comment.
✅ VRT updates are as expected. I ran them locally to double-check all tests pass.
✅ Code changes look as expected.
Thank you for adding the kitchen sink story 🙏🏻 I really like that pattern.
🟢 Good to go (especially because we're merging into a feature branch).
Co-authored-by: Tomasz Kajtoch <tomek@kajto.ch>
| right: css` | ||
| &:not(:only-child) { | ||
| ${logicalCSS('margin-left', euiTheme.size.xs)} | ||
| ${logicalCSS('margin-left', euiTheme.size.xxs)} |
There was a problem hiding this comment.
Hey @tkajtoch, thank you so much for the changes 🙏🏻 Looks perfect, but I have only one question/neat: I know in design it is 8px padding from left/right to the icon. But since here in code the border is counted too, it looks just a liiiittle too much, and I think we could go for 6px from both sider. Would that change be possible?



There was a problem hiding this comment.
We don't have a token for 6px spacing, so the thing that made the most sense to me was subtracting the border width from the size s used for inline padding. The resulting inline padding is 7px, which I think looks good. Let me know!
There was a problem hiding this comment.
Let's go with it, works for me!
A bit of a side question, but I wonder if we should actually introduce those tokens. For smaller elements they might make sense to perfectly balance the composition sometimes... cc @JoseLuisGJ
I wonder what do you both think? We we can continue discussion somewhere else of course, just wanted to mention in a context :)

There was a problem hiding this comment.
I personally think it could be a little too much in terms of available options considering there are also values above base, but I'd love to hear others' opinion on this.
Let me merge this PR as-is then and we can discuss the sizing tokens somewhere else - how about a slack thread? :)
… to make the visual padding equal 8px
💚 Build SucceededHistory
cc @tkajtoch |
💚 Build Succeeded
History
cc @tkajtoch |
`112.0.0` ⏩ `112.1.0` [Questions? Please see our Kibana upgrade FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams) ## Changes - Update `span_links_badge.tsx` conditional `onClick` props on `EuiBadge` to satisfy TypeScript 93d7fae - Update snapshots 24c2f9a ## Package updates ### `@elastic/eui` [`v112.1.0`](https://github.com/elastic/eui/releases/tag/v112.1.0) - Updated `timeline` icon glyph ([#9331](elastic/eui#9331)) - Updated `EuiContextMenu` panels to allow passing `data-test-subj`, `aria-label`, `className` and `css` props ([#9323](elastic/eui#9323)) - Added "zoom in" functionality to time window buttons in `EuiSuperDatePicker` ([#9325](elastic/eui#9325)) - Added `displayName` to `EuiButton`, `EuiButtonEmpty`, `EuiDescriptionList` and its sub-components, `EuiEmptyPrompt`, `EuiFlexGrid`, `EuiFlexItem`, `EuiIcon`, `EuiImage`, `EuiLoadingLogo`, `EuiPageSection`, `EuiPageSidebar`, `EuiPageTemplate` and its sub-components and `EuiPanel` ([#9324](elastic/eui#9324)) - Added `fill` prop (defaults to `false`) to `EuiBadge` component that controls whether the badge should use filled or non-filled (less intense) colors. By default, badges will now render as the non-filled variant. ([#9306](elastic/eui#9306)) - Updated EuiBadge design to have rounded corners and improved paddings ([#9302](elastic/eui#9302)) **Bug fixes** - Fixed non-virtualized `EuiSelectable` throwing SyntaxError when selecting an option ([#9326](elastic/eui#9326)) - Fixed an issue where `push` flyouts in a stacked layout calculated the content offset based on the hidden main flyout's width instead of the visible child flyout's width ([#9322](elastic/eui#9322)) ### @elastic/eui-theme-borealis [`v5.4.0`](https://github.com/elastic/eui/blob/16f9b31d753d963d7738049e7a176fcaf6e81e73/packages/eui-theme-borealis/changelogs/CHANGELOG_2026.md#v540) - Updated `badgeBackground` color token value to equal `backgroundFilledText` ([#9306](elastic/eui#9306)) ### @elastic/eui-docusaurus-theme [`v2.2.0`](https://github.com/elastic/eui/blob/16f9b31d753d963d7738049e7a176fcaf6e81e73/packages/docusaurus-theme/changelogs/CHANGELOG_2026.md#v220) - Added `extraFiles` prop to the `Demo` component. It allows to pass extra files that will be added to the Codesandbox instance. ([#9317](elastic/eui#9317)) - Updated the `IMPORT_REGEX` to include relative imports so that all imports are removed from the snippet. All imported references have to be passed to `Demo` in the `scope` prop. ([#9317](elastic/eui#9317)) --------- Co-authored-by: Tomasz Kajtoch <tomasz.kajtoch@elastic.co>
`112.0.0` ⏩ `112.1.0` [Questions? Please see our Kibana upgrade FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams) ## Changes - Update `span_links_badge.tsx` conditional `onClick` props on `EuiBadge` to satisfy TypeScript 93d7fae - Update snapshots 24c2f9a ## Package updates ### `@elastic/eui` [`v112.1.0`](https://github.com/elastic/eui/releases/tag/v112.1.0) - Updated `timeline` icon glyph ([elastic#9331](elastic/eui#9331)) - Updated `EuiContextMenu` panels to allow passing `data-test-subj`, `aria-label`, `className` and `css` props ([elastic#9323](elastic/eui#9323)) - Added "zoom in" functionality to time window buttons in `EuiSuperDatePicker` ([elastic#9325](elastic/eui#9325)) - Added `displayName` to `EuiButton`, `EuiButtonEmpty`, `EuiDescriptionList` and its sub-components, `EuiEmptyPrompt`, `EuiFlexGrid`, `EuiFlexItem`, `EuiIcon`, `EuiImage`, `EuiLoadingLogo`, `EuiPageSection`, `EuiPageSidebar`, `EuiPageTemplate` and its sub-components and `EuiPanel` ([elastic#9324](elastic/eui#9324)) - Added `fill` prop (defaults to `false`) to `EuiBadge` component that controls whether the badge should use filled or non-filled (less intense) colors. By default, badges will now render as the non-filled variant. ([elastic#9306](elastic/eui#9306)) - Updated EuiBadge design to have rounded corners and improved paddings ([elastic#9302](elastic/eui#9302)) **Bug fixes** - Fixed non-virtualized `EuiSelectable` throwing SyntaxError when selecting an option ([elastic#9326](elastic/eui#9326)) - Fixed an issue where `push` flyouts in a stacked layout calculated the content offset based on the hidden main flyout's width instead of the visible child flyout's width ([elastic#9322](elastic/eui#9322)) ### @elastic/eui-theme-borealis [`v5.4.0`](https://github.com/elastic/eui/blob/16f9b31d753d963d7738049e7a176fcaf6e81e73/packages/eui-theme-borealis/changelogs/CHANGELOG_2026.md#v540) - Updated `badgeBackground` color token value to equal `backgroundFilledText` ([elastic#9306](elastic/eui#9306)) ### @elastic/eui-docusaurus-theme [`v2.2.0`](https://github.com/elastic/eui/blob/16f9b31d753d963d7738049e7a176fcaf6e81e73/packages/docusaurus-theme/changelogs/CHANGELOG_2026.md#v220) - Added `extraFiles` prop to the `Demo` component. It allows to pass extra files that will be added to the Codesandbox instance. ([elastic#9317](elastic/eui#9317)) - Updated the `IMPORT_REGEX` to include relative imports so that all imports are removed from the snippet. All imported references have to be passed to `Demo` in the `scope` prop. ([elastic#9317](elastic/eui#9317)) --------- Co-authored-by: Tomasz Kajtoch <tomasz.kajtoch@elastic.co>
Summary
Resolves #9299
This PR updates the styles of the
EuiBadgecomponent to apply the latest design changes - rounded corners, updated paddings, and spacing between text and icon.Please note that the VRTs highlight rather important changes that need approval from the design team:
Both of the above could be reverted to the old, less rounded design if necessary, but that would mean more code changes.
Why are we making this change?
Part of the EuiBadge design update epic.
Screenshots #
Impact to users
These style changes are global, and there's no way to opt out of them. The changes themselves are minimal and limited to just the presentation layer. No logic changes have been implemented.
QA
Remove or strikethrough items that do not apply to your PR.
General checklist